﻿Public Class frmMain
    Private Sub frmMain_Load(sender As Object, e As EventArgs) Handles Me.Load
        lblVersion.Text = Application.ProductVersion

        Dim tCommandLineArgs As System.Collections.ObjectModel.ReadOnlyCollection(Of String) = My.Application.CommandLineArgs

        upExec.RepositoryServer = "http://sanguinesw.azurewebsites.net"
        upExec.RepositoryFolder = "/software/SAUpdater"
        upExec.VersionFile = "Update.html"

        upExec.ProcessCommandLineArguments(tCommandLineArgs)
        upExec.ApplicationTitle = "SA Updater"
        upExec.UpdaterTitle = "Installer"

        'upExec.AddNewSetting(1, "")
        'upExec.AddNewSetting(2, 2)
        'upExec.AddNewSetting(3, False)
    End Sub

    Private Sub btnNotes_Click(sender As Object, e As EventArgs) Handles btnNotes.Click
        Dim f As New frmNotes
        f.ShowDialog(Me)
    End Sub

    Private Sub btnClose_Click(sender As Object, e As EventArgs) Handles btnClose.Click
        Me.Close()
    End Sub

    Private Sub upExec_InstallCompleted(Success As Boolean) Handles upExec.InstallCompleted
        btnClose.Enabled = True
        btnNotes.Enabled = True
    End Sub

    Private Sub upExec_InstallStarted(Success As Boolean) Handles upExec.InstallStarted
        btnNotes.Enabled = False
        btnClose.Enabled = False
    End Sub

    Private Sub lblPoweredBy_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs) Handles lblPoweredBy.LinkClicked
        Process.Start("http://www.sanguineadvantage.com/")
    End Sub
End Class
